<ul class="goodslist-qiang clearfix">

<?php if ($this->_var['promotion_goods']): ?>

<script >
var Tday = new Array();
var daysms = 24 * 60 * 60 * 1000
var hoursms = 60 * 60 * 1000
var Secondms = 60 * 1000
var microsecond = 1000
var DifferHour = -1
var DifferMinute = -1
var DifferSecond = -1
function clock(key)
  {
   var time = new Date()
   var hour = time.getHours()
   var minute = time.getMinutes()
   var second = time.getSeconds()
   var timevalue = ""+((hour > 12) ? hour-12:hour)
   timevalue +=((minute < 10) ? ":0":":")+minute
   timevalue +=((second < 10) ? ":0":":")+second
   timevalue +=((hour >12 ) ? " PM":" AM")
   var convertHour = DifferHour
   var convertMinute = DifferMinute
   var convertSecond = DifferSecond
   var Diffms = Tday[key].getTime() - time.getTime()
   //DifferHour = Math.floor(Diffms / daysms)
   //Diffms -= DifferHour * daysms
   DifferMinute = Math.floor(Diffms / hoursms)
   Diffms -= DifferMinute * hoursms
   DifferSecond = Math.floor(Diffms / Secondms)
   Diffms -= DifferSecond * Secondms
   var dSecs = Math.floor(Diffms / microsecond)
   
   if(convertHour != DifferHour) a="还剩<strong class='tcd-h'>"+DifferHour+"</strong>天";
   if(convertMinute != DifferMinute) b="还剩<strong class='tcd-h'>"+DifferMinute+"</strong>时";
   if(convertSecond != DifferSecond) c="<strong class='tcd-m'>"+DifferSecond+"</strong>分"
     d="<strong class='tcd-s'>"+dSecs+"</strong>秒"
     if (DifferHour>0) {a=a} 
     else {a=''}
   document.getElementById("leftTime"+key).innerHTML = a + b + c + d; //显示倒计时信息
  
  }
</script>

<?php $_from = get_promote_goods2(); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods');$this->_foreach['promotion_foreach'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['promotion_foreach']['total'] > 0):
    foreach ($_from AS $this->_var['goods']):
        $this->_foreach['promotion_foreach']['iteration']++;
?>
							<li>

									<div class="prod-countdown" id="leftTime<?php echo ($this->_foreach['promotion_foreach']['iteration'] - 1); ?>">还剩<strong class="tcd-h">00</strong>时<strong class="tcd-m">00</strong>分<strong class="tcd-s">00</strong>秒</div>

									<dl>

										<dt>

											<a class="pimg" target="_blank" href="<?php echo $this->_var['goods']['url']; ?>">

												<img src="themes/yesmywine/images/1px.gif" original="<?php echo $this->_var['goods']['thumb']; ?>" width="110" height="180" alt="<?php echo htmlspecialchars($this->_var['goods']['name']); ?>" />

											</a>

										</dt>

										<dd class="base">

											<a title="<?php echo htmlspecialchars($this->_var['goods']['name']); ?>" class="pname" target="_blank" href="<?php echo $this->_var['goods']['url']; ?>">

												<?php echo $this->_var['goods']['short_style_name']; ?>

											</a>

											<p class="price">

												<span class="minprice"><label>抢购价：</label>&yen;<strong><?php echo $this->_var['goods']['promote_price']; ?></strong></span>

											</p>

										</dd>
                                   <?php if ($this->_var['goods']['brief']): ?>
										<dd class="slogan">
												<p><?php echo $this->_var['goods']['brief']; ?></p>
										</dd>
                                  <?php endif; ?>

										</dl>

								</li>
<script>
Tday[<?php echo ($this->_foreach['promotion_foreach']['iteration'] - 1); ?>] = new Date(<?php echo $this->_var['goods']['promote_end_date']; ?>*1000);   
window.setInterval(function()     
{clock(<?php echo ($this->_foreach['promotion_foreach']['iteration'] - 1); ?>);}, 1000);     
</script>      
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
<?php endif; ?>

</ul>